package com.ship.dispatch.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ship.dispatch.bean.SpDispatchScheme;
import com.ship.dispatch.bean.SpYearPlanScheme;
import com.ship.dispatch.bean.SpYearlyPlan;
import com.ship.dispatch.vo.ConResourceSellerVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 年度计划 Mapper 接口
 * </p>
 *
 * @author AbyssRabbit@163.com
 * @since 2023-10-17
 */
public interface SpYearlyPlanMapper extends BaseMapper<SpYearlyPlan> {

    /**
     * 找出最新的方案
     *
     * @param userId
     * @param planId
     * @return
     */
    SpYearPlanScheme selectMaxNumber(@Param(value = "userId") String userId,
                                     @Param(value = "planId") Long planId);

    /**
     * 找出最大的分享号
     *
     * @param planId
     * @return
     */
    SpYearPlanScheme selectMaxShareNumber(Long planId);

    /**
     * 根据用户id找出最大的方案号
     *
     * @param userId
     * @param planId
     * @return
     */
    SpDispatchScheme selectMaxDispatchNumber(String userId, Long planId);

    /**
     * 找出最大的分享方案号
     *
     * @param planId
     * @return
     */
    SpDispatchScheme selectDispatchMaxShareNumber(Long planId);

    List<ConResourceSellerVO> selectAllSellersByScheme(Long schemeId);
}